home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gdevsvga.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.3 KB  |  96 lines

  1. /* Copyright (C) 1989, 1995, 1998 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gdevsvga.h,v 1.2 2000/09/19 19:00:23 lpd Exp $ */
  20. /* Common definitions and procedures for SuperVGA drivers */
  21. /* Requires gdevpcfb.h */
  22.  
  23. #ifndef gdevsvga_INCLUDED
  24. #  define gdevsvga_INCLUDED
  25.  
  26. /* Common procedures */
  27.  
  28.     /* See gxdevice.h for the definitions of the procedures. */
  29.  
  30. dev_proc_close_device(svga_close);
  31. dev_proc_map_rgb_color(svga_map_rgb_color);
  32. dev_proc_map_color_rgb(svga_map_color_rgb);
  33. dev_proc_fill_rectangle(svga_fill_rectangle);
  34. dev_proc_copy_mono(svga_copy_mono);
  35. dev_proc_copy_color(svga_copy_color);
  36. dev_proc_get_params(svga_get_params);
  37. dev_proc_put_params(svga_put_params);
  38. dev_proc_get_bits(svga_get_bits);
  39. dev_proc_copy_alpha(svga_copy_alpha);
  40.  
  41. /* Table structure for looking up graphics modes. */
  42. typedef struct {
  43.     int width, height;        /* "key" */
  44.     int mode;            /* "value" */
  45. } mode_info;
  46.  
  47. /* The device descriptor structure */
  48. typedef struct gx_device_svga_s gx_device_svga;
  49. struct gx_device_svga_s {
  50.     gx_device_common;
  51.     int (*get_mode) (P0());
  52.     void (*set_mode) (P1(int));
  53.     void (*set_page) (P3(gx_device_svga * fbdev, int pnum, int wnum));
  54.     bool fixed_colors;        /* if true, used a fixed palette */
  55.     const mode_info *mode;    /* BIOS display mode info */
  56.     uint raster;        /* frame buffer bytes per line */
  57.     int current_page;        /* current page */
  58.     int wnum_read, wnum_write;    /* window #s for read vs. write */
  59.     /* Following are device-specific. */
  60.     union {
  61.     struct {
  62.         void (*bios_set_page) (P2(int, int));    /* set-page function */
  63.         int pn_shift;    /* log2(64K/granularity) */
  64.     } vesa;
  65.     struct {
  66.         int select_reg;    /* page-select register */
  67.     } atiw;
  68.     struct {
  69.         int et_model;    /* 4 for ET4000, */
  70.         /* 3 for ET3000 */
  71.     } tseng;
  72.     } info;
  73. };
  74.  
  75. /* The initial parameters map an appropriate fraction of */
  76. /* the screen to a full-page coordinate space. */
  77. /* This may or may not be what is desired! */
  78. #define svga_color_device(procs, name, depth, maxv, dither, get_mode, set_mode, set_page) {\
  79.     std_device_color_body(gx_device_svga, &procs, name,\
  80.       640, 480,\
  81.       480 / PAGE_HEIGHT_INCHES, 480 / PAGE_HEIGHT_INCHES,\
  82.       /*dci_color(*/depth, maxv, dither/*)*/),\
  83.      { 0 },        /* std_procs */\
  84.     get_mode, set_mode, set_page,\
  85.     0 /*fixed_colors*/\
  86.    }
  87. #define svga_device(procs, name, get_mode, set_mode, set_page)\
  88.   svga_color_device(procs, name, 8, 31, 4, get_mode, set_mode, set_page)
  89.  
  90. /* Utility procedures */
  91. void svga_init_colors(P1(gx_device *));
  92. int svga_find_mode(P2(gx_device *, const mode_info *));
  93. int svga_open(P1(gx_device *));
  94.  
  95. #endif /* gdevsvga_INCLUDED */
  96.